package com.itchen.until;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.io.InputStream;

/**
 * @author げっしょく
 * @date 2021/8/30
 */

public class RequestUntil {
    private static SqlSessionFactory sql;

    static {
        InputStream is = null;
        try {
            is = Resources.getResourceAsStream("mybatis-config.xml");
            sql = new SqlSessionFactoryBuilder().build(is);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public static SqlSessionFactory untilSqlSessionFactory(){
        return sql;
    }
}
